import hyRequest from '@/service'

// 获取所有角色
export function getAllRoles() {
  hyRequest.post({
    url: '/role/list'
  })
}

export function getAllRolesMock() {
  return {
    code: 0,
    data: [
      {
        id: 1,
        name: '超级管理员'
      }
    ]
  }
}

// 获取所有部门
export function getAllDepartments() {
  hyRequest.post({
    url: '/department/list'
  })
}

export function getAllDepartmentsMock() {
  return {
    code: 0,
    data: [
      {
        id: 2,
        name: '研发部',
        parontId: 4,
        createAt: '2021-01-02T10:03:21.0002',
        updateAt: '2021-01-06T08:25:49.0002',
        leader: 'lilei'
      },
      {
        id: 1,
        name: '总裁办',
        parentId: null,
        createAt: '2021-01-02T10:03:09.000Z',
        updateAt: '2021-01-05T08:25:46.000Z',
        leader: 'coderwhy'
      }
    ]
  }
}
